
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int t=scan.nextInt();
        while(t-->0){
            int n=scan.nextInt();
            int ans=0;
            for(int i=0;i<n;i++){
                ans^=scan.nextInt();
            }
            if(ans==0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}

